<template>
  <el-row class="tables">
    <!-- 表格 头部 -->
    <el-row class="tableTh">
      <el-col :span="3">
        <span>需求日期</span>
      </el-col>
      <el-col :span="3">
        <span>产品编号</span>
      </el-col>
      <el-col :span="3">
        <span>产品名称</span>
      </el-col>
      <el-col :span="4">
        <span>需求方</span>
      </el-col>
      <el-col :span="3">
        <span>任务量</span>
      </el-col>
      <el-col :span="4">
        <span>加工进度</span>
      </el-col>
      <el-col :span="4">
        <span>超时天数</span>
      </el-col>
    </el-row>
    <!-- 表格行 -->
    <div v-if="tabList.length > 0" class="showDiv">
      <el-row v-for="(item,index) in tabList" :class="{ 'row-striped': index % 2 === 1 }" :key="item.id" class="tableTd">
        <el-col :span="3">
          <span>{{ item.deliveryDate }}</span>
        </el-col>
        <el-col :span="3">
          <span>{{ item.materialCode }}</span>
        </el-col>
        <el-col :span="3">
          <span>{{ item.materialName }}</span>
        </el-col>
        <el-col :span="4">
          <span>{{ item.customerName }}</span>
        </el-col>
        <el-col :span="3">
          <span>{{ item.planNum }}</span>
        </el-col>
        <el-col :span="4">
          <span>
            <el-progress :text-inside="true" :stroke-width="18" text-color="#333 !important" :percentage="item.proRate" :color="item.color = item.proRate <= 30 ? '#217CE1' : item.proRate <= 50 ? '#7e54f4':'#28CEAB'"></el-progress>
          </span>
        </el-col>
        <el-col :span="4">
          <span>{{ item.overDay}}</span>
        </el-col>
      </el-row>
    </div>
    <div v-else class="kong">暂无数据</div>
  </el-row>
</template>
<script>
export default {
  props: {
    tabList: {
      type: Array,
      default: function () {
        return []
      }
    }
  },
  data() {
    return {}
  },
  watch: {},
  mounted() {},
  methods: {}
}
</script>
<style lang='scss' scoped>
.row-striped {
  background-color: #1a284a; /* 背景色可以根据需要自定义 */
}
.tables {
  height: 100%;
  color: #fff;
  background: #101747;
  margin: 0;
  .showDiv {
    height: 87.5%;
  }
  .tableTh,
  .tableTd {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    .el-col {
      text-overflow: ellipsis; /*让截断的文字显示为点点。还有一个值是clip意截断不显示点点*/
      white-space: nowrap; /*让文字不换行*/
      overflow: hidden; /*超出要隐藏*/
    }
  }
  .tableTh {
    width: 100%;
    height: 12.5%;
    font-weight: bold;
    font-size: 16px;
    background: #022c54;
    color: #b1d6fb;
  }
  .tableTd {
    height: 12.5%;
    font-size: 14px;
    // font-weight: bold;
    color: #fbfbfb;
  }
  .kong {
    height: calc(100% - 65px);
    // background: url(../../../../assets/images/zwsj.png) no-repeat center;
    background-size: 50% auto;
    display: flex;
    align-items: center;
    justify-content: center; /*定义body的里的元素水平居中*/
    color: #fff;
    font-size: 0.8vw;
  }
}
</style>
